﻿using System.Runtime.Serialization;
using MyFloridaHouse.libSvDTO;

namespace MyFloridaHouse.libSTO
{

	/// <summary>
	/// File STO (server transfer object)
	/// </summary>
    [DataContract]
    public class FileSTO
    {
        byte[] _fileData;
        FileInfoDTO _fileInfo;
        string _errorMessage;

		/// <summary>
		/// Initializes a new instance of the <see cref="FileSTO"/> class. The data is
		/// returned through the public property fileData as a byte array. Metadata is in
		/// two other properties.
		/// </summary>
        public FileSTO()
        {
            _fileData = new byte[0];
            _fileInfo = new FileInfoDTO();
            _errorMessage = "";
        }

		/// <summary>
		/// Gets or sets the file (blob) data.
		/// </summary>
		/// <value>The file data.</value>
        [DataMember]
        public byte[] fileData
        {
            get { return _fileData; }
            set { _fileData = value; }
        }

		/// <summary>
		/// Gets or sets the file info. Additional data used for screen display fields.
		/// </summary>
		/// <value>The file info.</value>
        [DataMember]
        public FileInfoDTO fileInfo
        {
            get { return _fileInfo; }
            set { _fileInfo = value; }
        }

		/// <summary>
		/// Gets or sets the error message.
		/// </summary>
		/// <value>The error message.</value>
        [DataMember]
        public string errorMessage
        {
            get { return _errorMessage; }
            set { _errorMessage = value; }
        }

    }
}
